Hydraulic pressure generating apparatuses that generate a brake hydraulic pressure generally include a master cylinder and a motor cylinder (for example, refer to WO-2011-099277-A). The master cylinder uses a brake operator as its drive source, and the motor cylinder uses a motor as its drive source.
The motor may be operated to increase the brake hydraulic pressure in a multiplying fashion, based on an operation amount of a brake pedal.
In such hydraulic pressure generating apparatus, an operation amount of the brake pedal is detected by a stroke sensor. The stroke sensor may be a magnetic sensor that detects a change in magnetic field, that is, a change in magnetic field caused by a rod that is moving, and outputs a detection signal to a control unit.
However, if a hydraulic pressure generating apparatus includes a solenoid valve, the stroke sensor which is disposed in the interior of a base body may be affected by a magnetic field generated from the electromagnetic valve which is also provided in the base body.